
package com.jf.cloud.order.service;

import com.jf.cloud.api.delivery.dto.DeliveryOrderDTO;
import com.jf.cloud.api.order.bo.EsPurchaseOrderBO;
import com.jf.cloud.common.product.vo.PurchaseSpuVO;
import com.jf.cloud.order.dto.PurchaseOrderDTO;
import com.jf.cloud.order.vo.PurchaseOrderVO;
import com.jf.cloud.order.vo.PurchaseSpuImportVO;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * 采购订单
 *
 * @author zz
 * @date 2022-06-22 17:12:02
 */
public interface PurchaseOrderService {
    /**
     * 保存
     * @param purchaseOrder
     */
    void savePurchaseOrder(PurchaseOrderDTO purchaseOrder);

    /**
     * 采购订单详情
     * @param purchaseOrderId
     * @param supplierId
     * @return
     */
    PurchaseOrderVO info(Long purchaseOrderId, Long supplierId);

    /**
     * 发货
     * @param deliveryOrderParam
     *
     */
    void delivery(DeliveryOrderDTO deliveryOrderParam);

    /**
     * 更新采购订单付款凭证
     * @param purchaseOrder
     */
    void updatePayVoucher(PurchaseOrderDTO purchaseOrder);

    /**
     * 供应商审核采购订单付款凭证
     * @param purchaseOrder
     */
    void auditVoucher(PurchaseOrderDTO purchaseOrder);

    /**
     * 入库
     * @param purchaseOrder
     * @return
     */
    void inbound(PurchaseOrderDTO purchaseOrder);

    /**
     * 作废
     * @param shopId
     * @param purchaseOrderId
     */
    void nullify(Long shopId, Long purchaseOrderId);

    /**
     * 完成采购订单
     * @param shopId
     * @param purchaseOrderId
     */
    void complete(Long shopId, Long purchaseOrderId);

    /**
     * 下载模板
     * @param response
     */
    void downloadModel(HttpServletResponse response);

    /**
     * 解析文件
     * @param excelFile
     * @param shopId
     * @return
     */
    PurchaseSpuImportVO parseFile(MultipartFile excelFile, Long shopId);

    /**
     * 获取采购订单需要保存到es中的数据
     * @param purchaseOrderId 采购订单id
     * @return
     */
    EsPurchaseOrderBO saveMongoAndGetEsInfo(Long purchaseOrderId);

    /**
     * 更新采购订单的状态
     * @param purchaseOrderIds 采购订单id
     * @param purchaseOrderStatus 采购订单状态
     * @return
     */
    void updatePurchaseOrderStatus(List<Long> purchaseOrderIds, Integer purchaseOrderStatus);
}
